package com.itheima.search.search.listener;

import com.itheima.common.contants.RabbitMQConstants;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author WXL
 */
@Component
public class Load2ESListener {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = RabbitMQConstants.QUEUE_ES),
            exchange = @Exchange(name = RabbitMQConstants.EXCHANGE_QUESTION, type = ExchangeTypes.TOPIC),
            key = RabbitMQConstants.ROUTING_KEY_ES
    ))
    public void loadQuestionToEs(String questId){
        System.out.println("导入问题到索引库" + questId);
    }

}
